{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "      <td>148</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>33.6</td>\n",
       "      <td>0.627</td>\n",
       "      <td>50</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>85</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>26.6</td>\n",
       "      <td>0.351</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8</td>\n",
       "      <td>183</td>\n",
       "      <td>64</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>23.3</td>\n",
       "      <td>0.672</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>66</td>\n",
       "      <td>23</td>\n",
       "      <td>94</td>\n",
       "      <td>28.1</td>\n",
       "      <td>0.167</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>137</td>\n",
       "      <td>40</td>\n",
       "      <td>35</td>\n",
       "      <td>168</td>\n",
       "      <td>43.1</td>\n",
       "      <td>2.288</td>\n",
       "      <td>33</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pregnancies  Glucose  BloodPressure  SkinThickness  Insulin   BMI  \\\n",
       "0            6      148             72             35        0  33.6   \n",
       "1            1       85             66             29        0  26.6   \n",
       "2            8      183             64              0        0  23.3   \n",
       "3            1       89             66             23       94  28.1   \n",
       "4            0      137             40             35      168  43.1   \n",
       "\n",
       "   DiabetesPedigreeFunction  Age  Outcome  \n",
       "0                     0.627   50        1  \n",
       "1                     0.351   31        0  \n",
       "2                     0.672   32        1  \n",
       "3                     0.167   21        0  \n",
       "4                     2.288   33        1  "
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#导入工具包\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "#读取数据文件，生成数据集\n",
    "data = pd.read_csv(\".\\AppData\\diabetes.csv\");\n",
    "#打印前5项数据\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(768, 9)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#打印数据行列\n",
    "data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 768 entries, 0 to 767\n",
      "Data columns (total 9 columns):\n",
      "Pregnancies                 768 non-null int64\n",
      "Glucose                     768 non-null int64\n",
      "BloodPressure               768 non-null int64\n",
      "SkinThickness               768 non-null int64\n",
      "Insulin                     768 non-null int64\n",
      "BMI                         768 non-null float64\n",
      "DiabetesPedigreeFunction    768 non-null float64\n",
      "Age                         768 non-null int64\n",
      "Outcome                     768 non-null int64\n",
      "dtypes: float64(2), int64(7)\n",
      "memory usage: 54.1 KB\n"
     ]
    }
   ],
   "source": [
    "#获取数据的类型\n",
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pregnancies                 0\n",
       "Glucose                     0\n",
       "BloodPressure               0\n",
       "SkinThickness               0\n",
       "Insulin                     0\n",
       "BMI                         0\n",
       "DiabetesPedigreeFunction    0\n",
       "Age                         0\n",
       "Outcome                     0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#查看是否有缺失值\n",
    "data.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>3.845052</td>\n",
       "      <td>120.894531</td>\n",
       "      <td>69.105469</td>\n",
       "      <td>20.536458</td>\n",
       "      <td>79.799479</td>\n",
       "      <td>31.992578</td>\n",
       "      <td>0.471876</td>\n",
       "      <td>33.240885</td>\n",
       "      <td>0.348958</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.369578</td>\n",
       "      <td>31.972618</td>\n",
       "      <td>19.355807</td>\n",
       "      <td>15.952218</td>\n",
       "      <td>115.244002</td>\n",
       "      <td>7.884160</td>\n",
       "      <td>0.331329</td>\n",
       "      <td>11.760232</td>\n",
       "      <td>0.476951</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.078000</td>\n",
       "      <td>21.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>62.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>27.300000</td>\n",
       "      <td>0.243750</td>\n",
       "      <td>24.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>3.000000</td>\n",
       "      <td>117.000000</td>\n",
       "      <td>72.000000</td>\n",
       "      <td>23.000000</td>\n",
       "      <td>30.500000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>0.372500</td>\n",
       "      <td>29.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>6.000000</td>\n",
       "      <td>140.250000</td>\n",
       "      <td>80.000000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>127.250000</td>\n",
       "      <td>36.600000</td>\n",
       "      <td>0.626250</td>\n",
       "      <td>41.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>17.000000</td>\n",
       "      <td>199.000000</td>\n",
       "      <td>122.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>846.000000</td>\n",
       "      <td>67.100000</td>\n",
       "      <td>2.420000</td>\n",
       "      <td>81.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Pregnancies     Glucose  BloodPressure  SkinThickness     Insulin  \\\n",
       "count   768.000000  768.000000     768.000000     768.000000  768.000000   \n",
       "mean      3.845052  120.894531      69.105469      20.536458   79.799479   \n",
       "std       3.369578   31.972618      19.355807      15.952218  115.244002   \n",
       "min       0.000000    0.000000       0.000000       0.000000    0.000000   \n",
       "25%       1.000000   99.000000      62.000000       0.000000    0.000000   \n",
       "50%       3.000000  117.000000      72.000000      23.000000   30.500000   \n",
       "75%       6.000000  140.250000      80.000000      32.000000  127.250000   \n",
       "max      17.000000  199.000000     122.000000      99.000000  846.000000   \n",
       "\n",
       "              BMI  DiabetesPedigreeFunction         Age     Outcome  \n",
       "count  768.000000                768.000000  768.000000  768.000000  \n",
       "mean    31.992578                  0.471876   33.240885    0.348958  \n",
       "std      7.884160                  0.331329   11.760232    0.476951  \n",
       "min      0.000000                  0.078000   21.000000    0.000000  \n",
       "25%     27.300000                  0.243750   24.000000    0.000000  \n",
       "50%     32.000000                  0.372500   29.000000    0.000000  \n",
       "75%     36.600000                  0.626250   41.000000    1.000000  \n",
       "max     67.100000                  2.420000   81.000000    1.000000  "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#获取特征值的统计属性\n",
    "data.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  6.   , 148.   ,  72.   , ...,  33.6  ,   0.627,  50.   ],\n",
       "       [  1.   ,  85.   ,  66.   , ...,  26.6  ,   0.351,  31.   ],\n",
       "       [  8.   , 183.   ,  64.   , ...,  23.3  ,   0.672,  32.   ],\n",
       "       ...,\n",
       "       [  5.   , 121.   ,  72.   , ...,  26.2  ,   0.245,  30.   ],\n",
       "       [  1.   , 126.   ,  60.   , ...,  30.1  ,   0.349,  47.   ],\n",
       "       [  1.   ,  93.   ,  70.   , ...,  30.4  ,   0.315,  23.   ]])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.preprocessing import Imputer\n",
    "#由于缺失值用的是0值编码，需要对缺失值进行填补\n",
    "imp = Imputer(missing_values=0.0, strategy='mean', axis=0)\n",
    "y = data['Outcome'].values\n",
    "X = data.drop(['Outcome'], axis=1)\n",
    "imp.fit(X)\n",
    "imp.transform(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "      <td>148</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>33.6</td>\n",
       "      <td>0.627</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>85</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>26.6</td>\n",
       "      <td>0.351</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8</td>\n",
       "      <td>183</td>\n",
       "      <td>64</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>23.3</td>\n",
       "      <td>0.672</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>66</td>\n",
       "      <td>23</td>\n",
       "      <td>94</td>\n",
       "      <td>28.1</td>\n",
       "      <td>0.167</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>137</td>\n",
       "      <td>40</td>\n",
       "      <td>35</td>\n",
       "      <td>168</td>\n",
       "      <td>43.1</td>\n",
       "      <td>2.288</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pregnancies  Glucose  BloodPressure  SkinThickness  Insulin   BMI  \\\n",
       "0            6      148             72             35        0  33.6   \n",
       "1            1       85             66             29        0  26.6   \n",
       "2            8      183             64              0        0  23.3   \n",
       "3            1       89             66             23       94  28.1   \n",
       "4            0      137             40             35      168  43.1   \n",
       "\n",
       "   DiabetesPedigreeFunction  Age  \n",
       "0                     0.627   50  \n",
       "1                     0.351   31  \n",
       "2                     0.672   32  \n",
       "3                     0.167   21  \n",
       "4                     2.288   33  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.head()   #数据貌似没有填充成功，需要老师指导下"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>3.845052</td>\n",
       "      <td>120.894531</td>\n",
       "      <td>69.105469</td>\n",
       "      <td>20.536458</td>\n",
       "      <td>79.799479</td>\n",
       "      <td>31.992578</td>\n",
       "      <td>0.471876</td>\n",
       "      <td>33.240885</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.369578</td>\n",
       "      <td>31.972618</td>\n",
       "      <td>19.355807</td>\n",
       "      <td>15.952218</td>\n",
       "      <td>115.244002</td>\n",
       "      <td>7.884160</td>\n",
       "      <td>0.331329</td>\n",
       "      <td>11.760232</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.078000</td>\n",
       "      <td>21.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>62.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>27.300000</td>\n",
       "      <td>0.243750</td>\n",
       "      <td>24.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>3.000000</td>\n",
       "      <td>117.000000</td>\n",
       "      <td>72.000000</td>\n",
       "      <td>23.000000</td>\n",
       "      <td>30.500000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>0.372500</td>\n",
       "      <td>29.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>6.000000</td>\n",
       "      <td>140.250000</td>\n",
       "      <td>80.000000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>127.250000</td>\n",
       "      <td>36.600000</td>\n",
       "      <td>0.626250</td>\n",
       "      <td>41.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>17.000000</td>\n",
       "      <td>199.000000</td>\n",
       "      <td>122.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>846.000000</td>\n",
       "      <td>67.100000</td>\n",
       "      <td>2.420000</td>\n",
       "      <td>81.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Pregnancies     Glucose  BloodPressure  SkinThickness     Insulin  \\\n",
       "count   768.000000  768.000000     768.000000     768.000000  768.000000   \n",
       "mean      3.845052  120.894531      69.105469      20.536458   79.799479   \n",
       "std       3.369578   31.972618      19.355807      15.952218  115.244002   \n",
       "min       0.000000    0.000000       0.000000       0.000000    0.000000   \n",
       "25%       1.000000   99.000000      62.000000       0.000000    0.000000   \n",
       "50%       3.000000  117.000000      72.000000      23.000000   30.500000   \n",
       "75%       6.000000  140.250000      80.000000      32.000000  127.250000   \n",
       "max      17.000000  199.000000     122.000000      99.000000  846.000000   \n",
       "\n",
       "              BMI  DiabetesPedigreeFunction         Age  \n",
       "count  768.000000                768.000000  768.000000  \n",
       "mean    31.992578                  0.471876   33.240885  \n",
       "std      7.884160                  0.331329   11.760232  \n",
       "min      0.000000                  0.078000   21.000000  \n",
       "25%     27.300000                  0.243750   24.000000  \n",
       "50%     32.000000                  0.372500   29.000000  \n",
       "75%     36.600000                  0.626250   41.000000  \n",
       "max     67.100000                  2.420000   81.000000  "
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(614, 8)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#训练数据和测试数据分离\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "#随机选择80%作为训练集，其余20%作为测试集\n",
    "X_train,X_test,y_train,y_test = train_test_split(X, y, test_size=0.2, random_state=0)\n",
    "X_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "#数据标准化处理\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "#分别初始化对特征和目标值的标准化器\n",
    "ss_X = StandardScaler()\n",
    "ss_y = StandardScaler()\n",
    "\n",
    "#分别对训练和测试数据的特征以及目标值进行标准化处理\n",
    "X_train = ss_X.fit_transform(X_train)\n",
    "X_test = ss_X.fit_transform(X_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Logistic回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'penalty': ['l1', 'l2'], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=0)"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "\n",
    "#正则参数 l1,l2  C\n",
    "penaltys = ['l1', 'l2']\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "\n",
    "turned_params = dict(penalty=penaltys, C=Cs)\n",
    "lr_penalty = LogisticRegression()\n",
    "\n",
    "#使用GrisSearchSV进行模型训练\n",
    "grid = GridSearchCV(lr_penalty, turned_params, cv=5, scoring='neg_log_loss')\n",
    "grid.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split0_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split1_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split2_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split3_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split4_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'mean_fit_time': array([0.00080013, 0.00140014, 0.00100002, 0.00120001, 0.00140014,\n",
       "        0.00180016, 0.00140014, 0.00140004, 0.00180011, 0.00160012,\n",
       "        0.00180016, 0.00160007, 0.00160007, 0.0018002 ]),\n",
       " 'std_fit_time': array([4.00066404e-04, 4.89959789e-04, 1.16800773e-07, 4.00042545e-04,\n",
       "        4.89862441e-04, 3.99994861e-04, 4.89959789e-04, 4.90037648e-04,\n",
       "        7.48468405e-04, 4.89862441e-04, 3.99994889e-04, 8.00096994e-04,\n",
       "        4.90018183e-04, 4.00018735e-04]),\n",
       " 'mean_score_time': array([0.00100002, 0.00159998, 0.00140014, 0.00100007, 0.00099998,\n",
       "        0.00120001, 0.00119996, 0.0012002 , 0.00140004, 0.00120006,\n",
       "        0.00180011, 0.00099998, 0.00160003, 0.00120001]),\n",
       " 'std_score_time': array([1.90734863e-07, 8.00049306e-04, 4.90057140e-04, 1.16800773e-07,\n",
       "        9.53674316e-08, 4.00042545e-04, 4.00066376e-04, 4.00066404e-04,\n",
       "        4.89842988e-04, 4.00018706e-04, 1.60012246e-03, 9.53674316e-08,\n",
       "        8.00132751e-04, 4.00042545e-04]),\n",
       " 'param_C': masked_array(data=[0.001, 0.001, 0.01, 0.01, 0.1, 0.1, 1, 1, 10, 10, 100,\n",
       "                    100, 1000, 1000],\n",
       "              mask=[False, False, False, False, False, False, False, False,\n",
       "                    False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'param_penalty': masked_array(data=['l1', 'l2', 'l1', 'l2', 'l1', 'l2', 'l1', 'l2', 'l1',\n",
       "                    'l2', 'l1', 'l2', 'l1', 'l2'],\n",
       "              mask=[False, False, False, False, False, False, False, False,\n",
       "                    False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'params': [{'C': 0.001, 'penalty': 'l1'},\n",
       "  {'C': 0.001, 'penalty': 'l2'},\n",
       "  {'C': 0.01, 'penalty': 'l1'},\n",
       "  {'C': 0.01, 'penalty': 'l2'},\n",
       "  {'C': 0.1, 'penalty': 'l1'},\n",
       "  {'C': 0.1, 'penalty': 'l2'},\n",
       "  {'C': 1, 'penalty': 'l1'},\n",
       "  {'C': 1, 'penalty': 'l2'},\n",
       "  {'C': 10, 'penalty': 'l1'},\n",
       "  {'C': 10, 'penalty': 'l2'},\n",
       "  {'C': 100, 'penalty': 'l1'},\n",
       "  {'C': 100, 'penalty': 'l2'},\n",
       "  {'C': 1000, 'penalty': 'l1'},\n",
       "  {'C': 1000, 'penalty': 'l2'}],\n",
       " 'split0_test_score': array([-0.69314718, -0.64954935, -0.67752065, -0.55050809, -0.52015504,\n",
       "        -0.50840971, -0.50775606, -0.50641233, -0.50661864, -0.50649916,\n",
       "        -0.5065253 , -0.50651264, -0.50651583, -0.50651403]),\n",
       " 'split1_test_score': array([-0.69314718, -0.64377437, -0.68667276, -0.52266356, -0.47092849,\n",
       "        -0.46020944, -0.45386688, -0.45398684, -0.45358509, -0.45361168,\n",
       "        -0.45357482, -0.45357866, -0.45357233, -0.45357541]),\n",
       " 'split2_test_score': array([-0.69314718, -0.64887231, -0.67733845, -0.54084756, -0.4933398 ,\n",
       "        -0.47975038, -0.4723219 , -0.47245305, -0.47191991, -0.47195322,\n",
       "        -0.47190374, -0.47190786, -0.47190279, -0.47190337]),\n",
       " 'split3_test_score': array([-0.69314718, -0.65084671, -0.67470284, -0.56803665, -0.563028  ,\n",
       "        -0.56673903, -0.58335953, -0.58502473, -0.58807777, -0.5882549 ,\n",
       "        -0.58858695, -0.58860165, -0.58861916, -0.58863657]),\n",
       " 'split4_test_score': array([-0.69314718, -0.64470235, -0.68399553, -0.52907199, -0.48033306,\n",
       "        -0.47431911, -0.47041901, -0.46968588, -0.46953387, -0.4694623 ,\n",
       "        -0.46945035, -0.46944411, -0.46944762, -0.46944234]),\n",
       " 'mean_test_score': array([-0.69314718, -0.64755154, -0.6800442 , -0.54221844, -0.50552814,\n",
       "        -0.49782892, -0.49746572, -0.49742985, -0.49786066, -0.49786951,\n",
       "        -0.49792109, -0.49792181, -0.49792435, -0.49792713]),\n",
       " 'std_test_score': array([0.        , 0.00278999, 0.0045084 , 0.01605135, 0.03310369,\n",
       "        0.03774843, 0.04626135, 0.04687065, 0.04816279, 0.04822427,\n",
       "        0.04836239, 0.04836699, 0.04837493, 0.04838134]),\n",
       " 'rank_test_score': array([14, 12, 13, 11, 10,  3,  2,  1,  4,  5,  6,  7,  8,  9]),\n",
       " 'split0_train_score': array([-0.69314718, -0.64518453, -0.67578546, -0.53318077, -0.48947333,\n",
       "        -0.48189105, -0.47854886, -0.47839753, -0.47834276, -0.47834126,\n",
       "        -0.47834068, -0.47834066, -0.47834066, -0.47834066]),\n",
       " 'split1_train_score': array([-0.69314718, -0.6486424 , -0.68801002, -0.54384713, -0.50501649,\n",
       "        -0.49476673, -0.49146771, -0.49131601, -0.49126117, -0.49125962,\n",
       "        -0.49125903, -0.49125901, -0.49125901, -0.49125901]),\n",
       " 'split2_train_score': array([-0.69314718, -0.64594027, -0.67592498, -0.53878788, -0.50146354,\n",
       "        -0.49089336, -0.48769781, -0.48753561, -0.48748174, -0.48748005,\n",
       "        -0.48747948, -0.48747946, -0.48747945, -0.48747945]),\n",
       " 'split3_train_score': array([-0.69314718, -0.64438501, -0.66875354, -0.52555816, -0.4760304 ,\n",
       "        -0.46592   , -0.46129487, -0.46117994, -0.46109747, -0.46109631,\n",
       "        -0.46109542, -0.46109541, -0.4610954 , -0.4610954 ]),\n",
       " 'split4_train_score': array([-0.69314718, -0.64801066, -0.68546076, -0.54174888, -0.50028292,\n",
       "        -0.4922723 , -0.48902705, -0.48888503, -0.48883193, -0.48883046,\n",
       "        -0.4888299 , -0.48882988, -0.48882987, -0.48882987]),\n",
       " 'mean_train_score': array([-0.69314718, -0.64643257, -0.67878695, -0.53662456, -0.49445334,\n",
       "        -0.48514869, -0.48160726, -0.48146282, -0.48140301, -0.48140154,\n",
       "        -0.4814009 , -0.48140088, -0.48140088, -0.48140088]),\n",
       " 'std_train_score': array([0.        , 0.001635  , 0.00703525, 0.00659438, 0.01057272,\n",
       "        0.01055091, 0.01105734, 0.01104395, 0.01105444, 0.01105429,\n",
       "        0.0110544 , 0.0110544 , 0.0110544 , 0.0110544 ])}"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#打印网格搜索回归的结果\n",
    "grid.cv_results_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.49742985268940926\n",
      "{'C': 1, 'penalty': 'l2'}\n"
     ]
    }
   ],
   "source": [
    "#选择最佳的正则函数和参数\n",
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 线性SVM "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import accuracy_score\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "%matplotlib inline\n",
    "\n",
    "#导入线性SVM包\n",
    "from sklearn.metrics import accuracy_score\n",
    "from sklearn.svm import LinearSVC\n",
    "\n",
    "#获取默认的线性SVM\n",
    "LSVC = LinearSVC()\n",
    "\n",
    "#训练模型\n",
    "LSVC.fit(X_train, y_train)\n",
    "\n",
    "#在校验集上做测试，评估性能\n",
    "y_predict = LSVC.predict(X_test)\n",
    "\n",
    "#print(\"Classification report for classifier %s:\\n%s\\n\"\n",
    "#      % (LSVC, metrics.classification_report(y_test, y_predict)))\n",
    "#print(\"Confusion matrix:\\n%s\" % metrics.confusion_matrix(y_test, y_predict))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "#自定义SVM回归模型\n",
    "def fit_grid_point_Linear(C, X_train, y_train, X_val, y_val):\n",
    "    \n",
    "    # 在训练集是那个利用SVC训练\n",
    "    SVC2 =  LinearSVC(C = C)\n",
    "    SVC2 = SVC2.fit(X_train, y_train)\n",
    "    \n",
    "    # 在校验集上返回accuracy\n",
    "    accuracy = SVC2.score(X_val, y_val)\n",
    "    \n",
    "    print(\"accuracy: {}\".format(accuracy))\n",
    "    return accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.7922077922077922\n",
      "accuracy: 0.8051948051948052\n",
      "accuracy: 0.7987012987012987\n",
      "accuracy: 0.8051948051948052\n",
      "accuracy: 0.7987012987012987\n",
      "accuracy: 0.6623376623376623"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "No handles with labels found to put in legend.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "accuracy: 0.7597402597402597\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XmcVfV9//HXh2FzQUBAiyyCgsgiihlwF8W5BlPjFheQuLWJ6aJpTZM2aZulpmlt0sS2qb8+ShZGUcE1ShTFYZGoAcMgCgKiI4iOKAwoKiL75/fH90znMgv3MnPPnLu8n4/HPGbuuefc+7ks5z3n+z3f79fcHRERkQPpkHQBIiKS/xQWIiKSkcJCREQyUliIiEhGCgsREclIYSEiIhkpLE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wFeS6qWtjKzicDfAZe4+/ak6ylh2awWKe0s6hT+FbDa3X+WdD1tYWZ96u92NLNDgApiOnfpbqiImT0CDCPcebMe+DN3fzfZqlrHzGqALsCWaNPiAr6z63Lg50AfYCvwsrt/PtmqsmdmXwD+AygDfu3uP0q4pFYzsxnAeYQZTjcC33f3XyVaVCuY2dnAc8AKwv93gL9399nJVdU6ZjYauJvw76sDYUXS22N5L4WFiIhkomYoERHJSGEhIiIZKSxERCQjhYWIiGSksBARkYwUFiIHwcy2Zd7rgMc/bGbHRT8fbmb/a2ZvRjOG/s7MTjOzztHPJTVoVvKbwkKknZjZSKDM3ddGm35JmJhvqLuPBG4EekeTDs4DrkmkUJFmKCxEWsGCn0RzWK0ws2ui7R3M7P9FVwpPmNlsM7syOmwK8Hi03/HAacA/uvs+gGh22iejfR+L9hfJC7rMFWmdK4BTgJMJI5qXmNnvgLOAQcBJwFGE6a9/HR1zFjAj+nkkYTT63hZe/1VgbCyVi7SCrixEWudsYEY04+dGYCHh5H428JC773P394EFacf0BeqyefEoRHZFi/OIJE5hIdI6zU0/fqDtAJ8BXaOfVwInm9mB/g92AXa0ojaRnFNYiLTO74BrooVn+gDnAn8gLGv5pajv4mjCxHv1VgNDANz9TaAa+KdoFlTMbGj9Gh5m1guoc/fd7fWBRA5EYSHSOr8BlgOvAPOBv42anR4hrGPxKmHd8BeBj6JjnmT/8PgK8EdAjZmtAH5Bw3oX5wMFNwuqFC/NOiuSY2Z2uLtvi64O/gCc5e7vR+sNLIget9SxXf8ajwLfKeD1x6XI6G4okdx7IlqQpjPww+iKA3f/zMy+T1iH++2WDo4WSnpMQSH5RFcWIiKSkfosREQkI4WFiIhkpLAQEZGMFBYiIpKRwkJERDJSWIiISEb/H1fRvkoLlSGRAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-3, 3, 7)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份  \n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "    tmp = fit_grid_point_Linear(oneC, X_train, y_train, X_test, y_test)\n",
    "    accuracy_s.append(tmp)\n",
    "\n",
    "x_axis = np.log10(C_s)\n",
    "pyplot.plot(x_axis, np.array(accuracy_s), 'b-')\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'accuracy' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在C=0.01或者C=1的时候，性能最优。SVM回归性能优于Logstic回归,SVM将线性问题转化为非线性处理，测试数据在SVM回归上更适合。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# RBF核的SVM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.svm import SVC\n",
    "\n",
    "def fit_grid_point_RBF(C, gamma, X_train, y_train, X_val, y_val):\n",
    "    \n",
    "    # 在训练集是那个利用SVC训练\n",
    "    SVC3 =  SVC(C=C, kernel='rbf', gamma = gamma)\n",
    "    SVC3 = SVC3.fit(X_train, y_train)\n",
    "    \n",
    "    # 在校验集上返回accuracy\n",
    "    accuracy = SVC3.score(X_test, y_test)\n",
    "    \n",
    "    print(\"accuracy: {}\".format(accuracy))\n",
    "    return accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.7012987012987013\n",
      "accuracy: 0.7857142857142857\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.8181818181818182\n",
      "accuracy: 0.7922077922077922\n",
      "accuracy: 0.7532467532467533\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.7987012987012987\n",
      "accuracy: 0.7662337662337663\n",
      "accuracy: 0.7142857142857143\n",
      "accuracy: 0.6883116883116883\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.7727272727272727\n",
      "accuracy: 0.7337662337662337\n",
      "accuracy: 0.7142857142857143\n",
      "accuracy: 0.6883116883116883\n",
      "accuracy: 0.6948051948051948\n"
     ]
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-2, 2, 5)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份 \n",
    "gamma_s = np.logspace(-2, 2, 5)  \n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "    for j, gamma in enumerate(gamma_s):\n",
    "        tmp = fit_grid_point_RBF(oneC, gamma, X_train, y_train, X_test, y_test)\n",
    "        accuracy_s.append(tmp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.7012987012987013\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.7012987012987013\n",
      "accuracy: 0.8181818181818182\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.7012987012987013\n",
      "accuracy: 0.8181818181818182\n",
      "accuracy: 0.7987012987012987\n",
      "accuracy: 0.7012987012987013\n",
      "accuracy: 0.8116883116883117\n",
      "accuracy: 0.8181818181818182\n",
      "accuracy: 0.7727272727272727\n"
     ]
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-1, 2, 4)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份 \n",
    "gamma_s = np.logspace(-5, -2, 4)  \n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "    for j, gamma in enumerate(gamma_s):\n",
    "        tmp = fit_grid_point_RBF(oneC, gamma, X_train, y_train, X_test, y_test)\n",
    "        accuracy_s.append(tmp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzs3Xl8zNf+x/HXmeyJbLLYiRLUlthVi6AtSpWWotWr6lK1tEX9bvWq9mqptva1aIuLVtFaeim1a0u1lqC2ij2o7JE9k5nz+2MmaUQik5jJd5Kc5+ORR83Md3mH9Htyvud8P0dIKVEURVGU+9FpHUBRFEWxf6qxUBRFUQqlGgtFURSlUKqxUBRFUQqlGgtFURSlUKqxUBRFUQqlGgtFURSlUKqxUBRFUQqlGgtFURSlUI5aB7AWf39/GRQUpHUMRVGUUuXo0aMxUsqAwrYrM41FUFAQR44c0TqGoihKqSKEuGrJduo2lKIoilIo1VgoiqIohbJpYyGE6CaEOC+EiBBCvJ3P5zWFEHuFEMeFECeFEE+Z339CCHFUCHHK/N/OtsypKIqi3J/NxiyEEA7AQuAJIBL4XQixRUp5Jtdmk4B1UsrFQoiGwDYgCIgBnpZS3hRCNAZ2ANVslVVRFEW5P1v2LFoDEVLKS1LKTGAt8EyebSTgZf6zN3ATQEp5XEp50/z+acBVCOFiw6yKoijKfdiysagGXM/1OpJ7ewfvA4OEEJGYehVj8jnOc8BxKWVG3g+EEMOFEEeEEEeio6Otk1pRFEW5h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t12CrvAHNQF34GXhONAD/Ny9fgWw17fc7XhnHRzH674KPPa0drQCvwDedo8t7vUNwHfc/K3AIbyzcw4Bnwg67rQ2TPmOgQeBD7j5CPBD4BjwCrAq6Jjn0JZ/BI64bfE8cG3QMWdpxxPAaWDM/Z18ArgXuNe9L8C3XDsPkeWMwqCnPNrxWd/2eAm4NeiYp2nLZrwupdeBg266vVTbxa7gNsYYk5N1QxljjMnJkoUxxpicLFkYY4zJyZKFMcaYnCxZGGOMycmShTEzICIX5rj+k+4qekSkXkQeFZHjbhTRF0XkFhGpdvMVfdGsmV8sWRhTIm7coZCqnnAvfQfvSvS1qnod3oi0beoNQvgL4M5AAjUmA0sWxsyCu0L2n0TksIgcEpE73etVbsiIIyLytIjsFZEPudX+BHeFvYisBm4BvqSqSfCGYlHVZ9yye9zyxpQFO8w1ZnY+CKwH1gFtwH4ReRFvKJWVwPV4IwAfBXa5dTbhXVEMcB1wUFUTWT7/MPA7RYncmFmwIwtjZmcz3uixCVXtAX6Jt3PfDPxQVZOqegZvSI+UpUBvPh/uksglEWkocNzGzIolC2NmJ9vNl6a7KdMI3jhX4I1HtE5EpvsbrAFGZxGbMQVnycKY2XkRuFNEQiLSjnf7zleA/8a7uVGViHTg3bYz5SiwBkC9e4kcAP7eN+rpWhHZ7uZbgV5VHStVg4yZjiULY2bnP/BG/3wN2Af8let2+hHe6KaHgUfx7mQ24NZ5hsuTxyfxbmp1TEQO4d3fInXvgfcCe4vbBGPyZ6POGlNgIlKv3p3XWvGONjap6hkRqcWrYWyaprCd+owfA1/Q3PeJN6Yk7GwoYwrvaRFZAlQDX3FHHKjqiIh8Ge+eyP+XbWV346Q9lihMObEjC2OMMTlZzcIYY0xOliyMMcbkZMnCGGNMTpYsjDHG5GTJwhhjTE6WLIwxxuT0/7XnmaiX/usjAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "accuracy_s1 =np.array(accuracy_s).reshape(len(C_s),len(gamma_s))\n",
    "x_axis = np.log10(C_s)\n",
    "for j, gamma in enumerate(gamma_s):\n",
    "    pyplot.plot(x_axis, np.array(accuracy_s1[:,j]), label = ' Test - log(gamma)' + str(np.log10(gamma)))\n",
    "\n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'accuracy' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    " BRF核的SVM，最佳参数为gamma为2.0，C=1或者gamma为3.0，C=10"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
